package com.hf.lookatme.zmodel.impls;

import android.content.Context;

import com.hf.lookatme.zbean.LoginRecordData;
import com.hf.lookatme.zmodel.IModel_LoginRecordData;
import com.hf.lookatme.zmodel.loadlistener.OnLoadLoginRecordDataListener;
import com.orhanobut.logger.Logger;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by JoeShiguang on 2015/5/19.
 */
public class Model_LoginRecordData implements IModel_LoginRecordData {

  //private DbUtils dbUtils;

  @Override
  public void getLoginRecordData(Context context, OnLoadLoginRecordDataListener loadLoginRecordDataListener) {

    //dbUtils = DBExecutor.instanceDbUtils(context);

    try {

      List<LoginRecordData> list_loginRecordData;
      //list_loginRecordData = dbUtils.findAll(Selector.from(LoginRecordData.class).orderBy("lastLoginTime"));
      list_loginRecordData = new ArrayList<LoginRecordData>();
      for (int i = 0; i < 4; i++) {
        LoginRecordData recordData = new LoginRecordData();
        recordData.setLoginName("1558967608" + i);
        list_loginRecordData.add(recordData);
      }
      loadLoginRecordDataListener.onLoadLoginRecordDataSuccess(list_loginRecordData);
    } catch (Exception ex) {
      Logger.e("get LoginRecordData failed.");
      loadLoginRecordDataListener.onLoadLoginRecordDataFailed("get LoginRecordData failed.");
    }
  }

}
